import 'package:flutter/material.dart';

class MySingleChildScrollView extends StatelessWidget {
  var _list = List.generate(100, (index)=> "$index- value");
  var _controller = ScrollController();
   MySingleChildScrollView() {
     _controller.addListener(() {
        print("scrolling");

     });
   }
  Widget _buildWidget(){
    return Column(
      children: _list.map((f)=>
         InkWell(onTap: (){
           print('-------------');
         }, child: Text(f,style: TextStyle(color: Colors.red[300],fontSize: 40),))).toList(),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Container(

          child: Scrollbar( //添加滚动条
            child: SingleChildScrollView(
              controller: _controller,
              physics: BouncingScrollPhysics(),
              scrollDirection: Axis.vertical,
              padding: const EdgeInsets.all(8.0),
              reverse: true,
              child: Center(
                child: _buildWidget()
              ),
            ),
          ),
        ),
      ),
    );
  }
}
